
import CryptoJS from "crypto-js";

const encryptionKey = "uujHHud12";

const Crypto = {
    //加密
    encryptData(data) {
        const encryptedData = CryptoJS.AES.encrypt(data, encryptionKey).toString();
        return encryptedData;
    },
    //解密
    decryptData(encryptedData) {
        let decryptedData = null
        if(encryptedData){
            decryptedData = CryptoJS.AES.decrypt(encryptedData, encryptionKey).toString(CryptoJS.enc.Utf8);
        }
        return decryptedData;
    }
}
export default Crypto

